{% if is_paginated %}
    <ul class="pagination justify-content-center mb-4">
        <li class="page-item"><a class="page-link" href="?page=1">首页</a></li>
            {% if page_obj.has_previous %}
                <li class="page-item"><a class="page-link" href="?page={{ page_obj.previous_page_number }}">上一页</a></li>
            {% else %}
                <li class="page-item disabled"><a class="page-link" href="#"><span>上一页</span></a></li>
            {% endif %}
            {% for i in page_range %}
                {% if page_obj.number == i %}
                    <li class="page-item active" aria-current="page"><a class="page-link btn-primary disabled" href="#">{{ i }} <span class="sr-only">(current)</span></a></li>
                {% else %}
                    <li class="page-item"><a class="page-link" href="?page={{ i }}">{{ i }}</a></li>
                {% endif %}
            {% endfor %}
            {% if page_obj.has_next %}
                <li class="page-item"><a class="page-link" href="?page={{ page_obj.next_page_number }}">下一页</a></li>
            {% else %}
                <li class="page-item disabled"><a class="page-link" href="#"><span>下一页</span></a></li>
            {% endif %}
        <li class="page-item"><a class="page-link" href="?page={{ paginator.num_pages }}">尾页</a></li>
    </ul>
        <div class="text-center">
          当前第{{ page_obj.number }}页，共{{ paginator.num_pages }}页
        </div><br>
{% endif %}
